﻿using System;
using System.Collections.Generic;
using System.Text;
using TheLogWatcher.Properties;

namespace TheLogWatcher
{
    public class StaticXmlStorage
    {
        private static FormatConfigs formatConfigs;

        public static FormatConfigs getLogFormatBaseDefs()
        {
            if (formatConfigs == null)
            {
                string startDirectory = Settings.Default.StartDirectory;
                string configFile = Settings.Default.FormatConfigFile;
                formatConfigs = ObjectXMLSerializer<FormatConfigs>.Load(startDirectory + configFile);
            }
            return formatConfigs;
        }

        private static Formats formatSettings;

        public static Formats getCustomLogFormats()
        {
            if (formatSettings == null)
            {
                string startDirectory = Settings.Default.StartDirectory;
                string settingsFile = Settings.Default.FormatSettingsFile;
                formatSettings = ObjectXMLSerializer<Formats>.Load(startDirectory + settingsFile);
            }
            return formatSettings;
        }
    }
}
